<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <div :class="classes"></div>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        let app = new Vue({
            el: '#app',
            data() {
                return {
                    isActived: true,
                    error: null
                }
            },
            computed: {
                classes: function(){
                    return{
                        active: this.isActive && !this.error,
                        'text-fail': this.error && this.error.type === 'fail'
                        }
                    }
                }
        })
    </script>
</body>

</html>